package com.ruoyi.safe.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.safe.mapper.CommonCooperatorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.safe.mapper.CommonCooperatorBankMapper;
import com.ruoyi.safe.domain.CommonCooperatorBank;
import com.ruoyi.safe.service.ICommonCooperatorBankService;

/**
 * 合作单位-银行信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-08
 */
@Service
public class CommonCooperatorBankServiceImpl implements ICommonCooperatorBankService 
{
    @Autowired
    private CommonCooperatorBankMapper commonCooperatorBankMapper;
    @Autowired
    private CommonCooperatorMapper commonCooperatorMapper;

    /**
     * 查询合作单位-银行信息
     * 
     * @param id 合作单位-银行信息主键
     * @return 合作单位-银行信息
     */
    @Override
    public CommonCooperatorBank selectCommonCooperatorBankById(Long id)
    {
        return commonCooperatorBankMapper.selectCommonCooperatorBankById(id);
    }

    /**
     * 查询合作单位-银行信息列表
     * 
     * @param commonCooperatorBank 合作单位-银行信息
     * @return 合作单位-银行信息
     */
    @Override
    public List<CommonCooperatorBank> selectCommonCooperatorBankList(CommonCooperatorBank commonCooperatorBank)
    {
        return commonCooperatorBankMapper.selectCommonCooperatorBankList(commonCooperatorBank);
    }

    /**
     * 新增合作单位-银行信息
     * 
     * @param commonCooperatorBank 合作单位-银行信息
     * @return 结果
     */
    @Override
    public int insertCommonCooperatorBank(CommonCooperatorBank commonCooperatorBank)
    {
        commonCooperatorBank.setCreateTime(DateUtils.getNowDate());
        commonCooperatorBank.setCreateBy(SecurityUtils.getUsername());
        return commonCooperatorBankMapper.insertCommonCooperatorBank(commonCooperatorBank);
    }

    /**
     * 修改合作单位-银行信息
     * 
     * @param commonCooperatorBank 合作单位-银行信息
     * @return 结果
     */
    @Override
    public int updateCommonCooperatorBank(CommonCooperatorBank commonCooperatorBank)
    {
        commonCooperatorBank.setUpdateTime(DateUtils.getNowDate());
        commonCooperatorBank.setUpdateBy(SecurityUtils.getUsername());
        return commonCooperatorBankMapper.updateCommonCooperatorBank(commonCooperatorBank);
    }

    /**
     * 批量删除合作单位-银行信息
     * 
     * @param ids 需要删除的合作单位-银行信息主键
     * @return 结果
     */
    @Override
    public int deleteCommonCooperatorBankByIds(Long[] ids)
    {
        return commonCooperatorBankMapper.deleteCommonCooperatorBankByIds(ids);
    }

    /**
     * 删除合作单位-银行信息信息
     * 
     * @param id 合作单位-银行信息主键
     * @return 结果
     */
    @Override
    public int deleteCommonCooperatorBankById(Long id)
    {
        return commonCooperatorBankMapper.deleteCommonCooperatorBankById(id);
    }
}
